<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link rel="stylesheet" href="/static/amis/sdk.css" />
    <link rel="stylesheet" href="/static/amis/helper.css" />
    <style>
      html,
      body,
      .app-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="root" class="app-wrapper"></div>
    <script src="/static/amis/sdk.js"></script>
    <script type="text/javascript">
		(function() {
			let amis = amisRequire('amis/embed');
			// 通过替换下面这个配置来生成不同页面
			//let sgdc = ${pageJsonStr}
      var url = "/base2Api/amis/json/contract_management"/*json文件url，本地的就写本地的位置，如果是服务器的就写服务器的路径*/
      var request = new XMLHttpRequest();
      request.open("get", url);/*设置请求方法与路径*/
      request.send(null);/*不发送数据到服务器*/
      request.onload = function () {/*XHR对象获取到返回信息后执行*/
        if (request.status == 200) {/*返回状态为200，即为数据获取成功*/
          var json = JSON.parse(request.responseText);
          console.log(json);
          amis.embed('#root', json);
        }
      }
		})();
	</script>
  </body>
</html>
